<!DOCTYPE html>
<html lang="en">
<head>
<title>huangliusong</title>
<script src="./vue.js"></script>
<style type="text/css">
	.activated{
		color:red;
	}
</style>
</head>
 
<body>
	<div id="app">
	<div @click="handleClick" :class="[activated,activatedOne]">
	<h1>dddddddd</h1></div>
	</div>

	<script type="text/javascript">
	var vm=new Vue({
		el:"#app",
		data:{
			activated:"",
			activatedOne:"activated-one"
		},
		methods:{
			handleClick:function(){
				//三元表达式
				this.activated=this.activated==="activated"?"":"activated"
			}
		}
	})
	</script>
</body>

</html>